import { useState } from "react";
import Counter from "./components/counter";

const Chapter9 = (props) => {
    const { title } = props;
    const [show, setShow] = useState(true);
    return (
        <div className='wrapper wrapper9'>
            <div className='page-header'>
                <h3>{title}</h3>
            </div>
            <div className='page-content'>
                {show && <Counter />}
                <button
                    className='btn btn-block btn-info'
                    onClick={() => setShow(!show)}
                >
                    切换
                </button>
            </div>
        </div>
    );
};

export default Chapter9;
